#pragma once
#include "mcpoint.h"
#include <fstream>

using namespace std;


class McPoint2D :
	public McPoint
{
public:
	McPoint2D(void);
	~McPoint2D(void);
	McPoint2D(double x1, double y1);
	McPoint2D(const McPoint &p);

	McPoint2D operator+(const McPoint2D& p);
	McPoint2D operator-(const McPoint2D& p);
	McPoint2D operator+=(const McPoint2D& p);
	McPoint2D operator-=(const McPoint2D& p);
	McPoint2D& operator=(const McPoint& p);
	McPoint2D operator*(const double scale);
	McPoint2D operator/(const double scale);
	bool operator==(const McPoint2D& p);

	friend ofstream & operator>>( McPoint2D &p, ofstream &strm);
	friend ifstream & operator<<(McPoint2D &p, ifstream &strm);

	double Distance(const McPoint& p) const;
	double Azimuth(const McPoint& p) const;

	double X() const;
	double Y() const;
	
	double GetX() const;
	double GetY() const;

	void SetX(const double x);
	void SetY(const double y);

	double& rX();
	double& rY();

	void Get(double& x1, double& y1) const;

	void Set(const double x1, const double y1);
	void Set(const double x, const double y, const double z);

private:
	double Z() const { return 0.0; };

	double GetZ() const { return 0.0; };	

	double& rZ() { return x; };
	
	void SetZ(const double z) {};

	

public:
	double x;
	double y;
};
